#include "red_black_tree.h"
#include "util.h"
#include "binary_tree.h"
#include "libdef.h"
#include "file_png.h"

int Compare(const void* a, const void* b)
{
	return *((int*)a) - *((int*)b);
}

void Print(const void *data)
{
	printf("%d -- %d\n", *((int*)data));
}

void PrintNode(RBTree *tree, RBNode *node, int index)
{
	int i = 0;
	if(node)
	{
		index++;
		PrintNode(tree, node->right, index);
		while(i < index)
		{
			printf(" ");
			i++;
		}
		printf("%d", *((int*)(node->data)));
		if(node->red)
			printf(" red");
		else
			printf(" black");
		printf("\n");
		PrintNode(tree, node->left, index);
		index--;
	}
}

void PrintTree(RBTree *tree)
{
	PrintNode(tree, tree->root, 0);
}

void change(size_t **a)
{
	size_t b = 10;
	*a = &b;
}

int main()
{
	size_t s = sizeof(BYTE);
	PNG* png = LoadPNG("d:\\pic.png");

	ReleasePNG(png);

	getchar();
	return 0;
}